package com.leave.mos.controller.find;

import com.leave.mos.entity.QueryParam;
import com.leave.mos.service.find.QueryAggregate1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @ClassName MongodbSaveController
 * @Description TODO
 * @Author lh
 * @Date 2021/7/7 17:42
 * @Version 1.0
 **/

@RestController
@RequestMapping("aggregateMethed")
public class QueryAggregate1Controller {

    @Autowired
    private QueryAggregate1Service queryAggregate1Service;

    @RequestMapping("/project")
    List<Map> project(QueryParam queryParam){
        return queryAggregate1Service.project(queryParam);
    }

    @RequestMapping("addFields")
    List<Map> addFields(QueryParam queryParam){
       return queryAggregate1Service.addFields(queryParam);
    }

    @RequestMapping("count")
    List<Map> count(QueryParam queryParam){
        return queryAggregate1Service.count(queryParam);
    }

    @RequestMapping("group")
    List<Map> group(QueryParam queryParam){
        return queryAggregate1Service.group(queryParam);
    }

    @RequestMapping("group1")
    List<Map> group1(QueryParam queryParam){
        return queryAggregate1Service.group1(queryParam);
    }

    @RequestMapping("group2")
    List<Map> group2(QueryParam queryParam){
        return queryAggregate1Service.group2(queryParam);
    }

}
